import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
// 配置登录页
import Login from '../views/Login.vue'
// 文章路由
import Publish from '@/views/Publish.vue'
import Compile from '@/views/Compile.vue'
Vue.use(VueRouter)

const routes = [{
    meta: {
      crumbs: '首页'
    },
    path: '/',
    name: 'Home',
    redirect: '/publish',
    component: Home,
    children: [{
        path: 'publish',
        component: Publish,
        meta: {
          crumbs: '文章列表'
        }
      },
      {
        path: 'compile',
        component: Compile,
        meta: {
          crumbs: '编辑文章'
        }
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: Login,
  }
]

const router = new VueRouter({
  routes
})

export default router